package com.vhall.component.dao.watchlimit;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.vhall.component.entity.watchlimit.ApplyUserEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * @author rui.zhou
 * @date 2021/5/26 15:42
 */
@Mapper
@Repository
public interface ApplyUsersMapper extends BaseMapper<ApplyUserEntity> {

    /**
     * 查询apply_users数据
     * 传两个房间id是为了兼容之前的il_id查询
     *
     * @param roomId 房间id
     * @param ilId   房间id
     * @param phone  电话
     * @return 返回值
     */
    @Select("select * from apply_users where (room_id= #{roomId} or il_id = #{ilId}) and phone = #{phone}")
    ApplyUserEntity findApplyUser(@Param("roomId") String roomId, @Param("ilId") Integer ilId, @Param("phone") String phone);
}
